<?php

/**
 * redirectorpageLive filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseredirectorpageLiveFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'RedirectionType' => new sfWidgetFormChoice(array('choices' => array('' => '', 'Internal' => 'Internal', 'External' => 'External'))),
      'ExternalURL'     => new sfWidgetFormFilterInput(),
      'LinkToID'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'RedirectionType' => new sfValidatorChoice(array('required' => false, 'choices' => array('Internal' => 'Internal', 'External' => 'External'))),
      'ExternalURL'     => new sfValidatorPass(array('required' => false)),
      'LinkToID'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('redirectorpage_live_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'redirectorpageLive';
  }

  public function getFields()
  {
    return array(
      'ID'              => 'Number',
      'RedirectionType' => 'Enum',
      'ExternalURL'     => 'Text',
      'LinkToID'        => 'Number',
    );
  }
}
